#ifndef TESTEVENT_H
#define TESTEVENT_H

#include "IGameEvent.h"
#include <sstream>

class TestEvent : public ENE::IGameEvent
{
public:
	static const ENE::UInt16 EventId = 100;

	TestEvent(float timestamp, ENE::Int8 data, ENE::Int8 sourceID=-1)
		: IGameEvent(EventId, timestamp, sourceID), m_data(data)
	{

	}

	TestEvent(std::istringstream& data) : IGameEvent(EventId)
	{
		data.read((char*)&m_data, sizeof(ENE::Int8));
	}

	//!Applique l'event au moteur de jeu afin de changer son etat
	void apply(ChuGame::StateData& state) const
	{
		
	}

protected:
	//!Serialize l'objet dans un flux
	void serializeEvent(std::ostringstream& buffer) const
	{
		buffer.write((char*)&m_data, sizeof(ENE::Int8));
	}

private:
	ENE::Int8 m_data;
};

#endif

